#include<stdio.h>
#include<unistd.h>

#include<wflyctrl.h>
#include<global_header.h>

static char buf[BUFSIZ];
int main(int argc, char **argv) {
    unsigned char r;
    int i;

    /* wfly test code */
    printf("init wfly...\n");
    r |= wfly_init();

    /* wfly test */
#if 0 /* init hand-shake */
    char user_input_char;
    do {
        printf("Press 'c' and 'Enter' to lanch.");
        user_input_char = getchar();
        setbuf(stdin, buf);
    } while(user_input_char != 'c');
#endif

    printf("launch after 1 second... \n");
    abs_usleep(1*1000*1000);


    printf("launch!!! \n");
    r |= wfly_lauch();

    printf("stop\n");
    r |= wfly_stop();

    if(r==0)
        printf("send data success!\n");
    else
        printf("send data fail\n");

    return 0;
}
